#include<iostream>
#include<queue>
using namespace std;
class point {
public:
	int x;
	int y;
	point(int _x, int _y) {
		x = _x;
		y = _y;
	}
	point() {}
	bool operator==(point &p) {
		if (x == p.x && y == p.y) {
			return true;
		}
		return false;
	}
	int getx() {
		return x;
	}
	int gety() {
		return y;
	}
};
int manhattanDist(const point &a, const point &b) {
	int dx = a.x * 10 - b.x * 10;
	dx = abs(dx);
	int dy = a.y * 10 - b.y * 10;
	dy = abs(dy);
	return dx + dy;
}
int calcG(const point &a, const point &b) {
	int mdist = manhattanDist(a, b);
	if (mdist == 10) {
		return 10;
	}
	else if (mdist == 20) {
		return 14;
	}
	return 0;
}
